<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  	<!--定义好页面编码 -->
    <meta charset="utf-8">  
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--描述：这里定义好移动端的自适应-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 模板</title>
    <!-- 引入好Bootstrap css样式文件 -->
    <link href="css/bootstrap.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
    <!--描述：引入js文件 记住一定要先引入JQuery的支持-->
    <script src="js/jquery-1.12.4.js"></script>
    <!-- 引入bootStrap的js文件-->
    <script src="js/bootstrap.js"></script>
    <script type="text/javascript">
    		$(function(){
					
					$("#showBtn").on("click",function(){
						
							$(".mydialog").attr("class", "modal show");
					});
					
					
    		});
    </script>
    
  </head>
  <body>
  	<!-- 这里写代码-->
		<div class="container">
			<div class="row">
				<div class="col-md-12">
					<button class="btn btn-primary" data-target="#mydialog" data-toggle="modal" id="showBtn">显示</button>
					<!-- 定义模态对话框-->
					<div class="modal fade" id="mydialog"  aria-labelledBy="title"  tabindex="-1">
						<div class="modal-dialog">
							<div class="modal-content">
								<div class="modal-header">
									<button class="close">&times;</button>
									<div class="h4 modal-title" id="title">我是模态对话框</div>
								</div>
								<div class="modal-body">
									<div class="row">
											<div class="col-md-4">
												<span>你好啊</span>
											</div>
											<div class="col-md-5">
												<span>我在舱室</span>
											</div>
									</div>
									<div class="row">
											<div class="col-md-4 col-md-offset-4 ">
												<span>你好啊</span>
											</div>
											<div class="col-md-4">
												<span>我在舱室</span>
											</div>
									</div>
								</div>
								<div class="modal-footer">
									<button class="btn btn-primary">关闭</button>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		
  </body>
</html>